3.1019 \(\int (g \cos (e+f x))^p (a+a \sin (e+f x))^m (A+B \sin (e+f x)) \, dx\)

Optimal. Leaf size=170 \[ -\frac{a 2^{\frac{1}{2} (2 m+p+1)} (A (m+p+1)+B m) (a \sin (e+f x)+a)^{m-1} (g \cos (e+f x))^{p+1} (\sin (e+f x)+1)^{\frac{1}{2} (-2 m-p+1)} \, _2F_1\left (\frac{1}{2} (-2 m-p+1),\frac{p+1}{2};\frac{p+3}{2};\frac{1}{2} (1-\sin (e+f x))\right )}{f g (p+1) (m+p+1)}-\frac{B (a \sin (e+f x)+a)^m (g \cos (e+f x))^{p+1}}{f g (m+p+1)} \]

[Out]

-((2^((1 + 2*m + p)/2)*a*(B*m + A*(1 + m + p))*(g*Cos[e + f*x])^(1 + p)*Hypergeometric2F1[(1 - 2*m - p)/2, (1
+ p)/2, (3 + p)/2, (1 - Sin[e + f*x])/2]*(1 + Sin[e + f*x])^((1 - 2*m - p)/2)*(a + a*Sin[e + f*x])^(-1 + m))/(
f*g*(1 + p)*(1 + m + p))) - (B*(g*Cos[e + f*x])^(1 + p)*(a + a*Sin[e + f*x])^m)/(f*g*(1 + m + p))

________________________________________________________________________________________

Rubi [A]  time = 0.269419, antiderivative size = 170, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 4, integrand size = 33, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.121, Rules used = {2860, 2689, 70, 69} \[ -\frac{a 2^{\frac{1}{2} (2 m+p+1)} (A (m+p+1)+B m) (a \sin (e+f x)+a)^{m-1} (g \cos (e+f x))^{p+1} (\sin (e+f x)+1)^{\frac{1}{2} (-2 m-p+1)} \, _2F_1\left (\frac{1}{2} (-2 m-p+1),\frac{p+1}{2};\frac{p+3}{2};\frac{1}{2} (1-\sin (e+f x))\right )}{f g (p+1) (m+p+1)}-\frac{B (a \sin (e+f x)+a)^m (g \cos (e+f x))^{p+1}}{f g (m+p+1)} \]

Antiderivative was successfully verified.

[In]

Int[(g*Cos[e + f*x])^p*(a + a*Sin[e + f*x])^m*(A + B*Sin[e + f*x]),x]

[Out]

-((2^((1 + 2*m + p)/2)*a*(B*m + A*(1 + m + p))*(g*Cos[e + f*x])^(1 + p)*Hypergeometric2F1[(1 - 2*m - p)/2, (1
+ p)/2, (3 + p)/2, (1 - Sin[e + f*x])/2]*(1 + Sin[e + f*x])^((1 - 2*m - p)/2)*(a + a*Sin[e + f*x])^(-1 + m))/(
f*g*(1 + p)*(1 + m + p))) - (B*(g*Cos[e + f*x])^(1 + p)*(a + a*Sin[e + f*x])^m)/(f*g*(1 + m + p))

Rule 2860

Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((c_.) + (d_.)*sin[(e_.)
 + (f_.)*(x_)]), x_Symbol] :> -Simp[(d*(g*Cos[e + f*x])^(p + 1)*(a + b*Sin[e + f*x])^m)/(f*g*(m + p + 1)), x]
+ Dist[(a*d*m + b*c*(m + p + 1))/(b*(m + p + 1)), Int[(g*Cos[e + f*x])^p*(a + b*Sin[e + f*x])^m, x], x] /; Fre
eQ[{a, b, c, d, e, f, g, m, p}, x] && EqQ[a^2 - b^2, 0] && NeQ[m + p + 1, 0]

Rule 2689

Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.), x_Symbol] :> Dist[(a^2*
(g*Cos[e + f*x])^(p + 1))/(f*g*(a + b*Sin[e + f*x])^((p + 1)/2)*(a - b*Sin[e + f*x])^((p + 1)/2)), Subst[Int[(
a + b*x)^(m + (p - 1)/2)*(a - b*x)^((p - 1)/2), x], x, Sin[e + f*x]], x] /; FreeQ[{a, b, e, f, g, m, p}, x] &&
 EqQ[a^2 - b^2, 0] &&  !IntegerQ[m]

Rule 70

Int[((a_) + (b_.)*(x_))^(m_)*((c_) + (d_.)*(x_))^(n_), x_Symbol] :> Dist[(c + d*x)^FracPart[n]/((b/(b*c - a*d)
)^IntPart[n]*((b*(c + d*x))/(b*c - a*d))^FracPart[n]), Int[(a + b*x)^m*Simp[(b*c)/(b*c - a*d) + (b*d*x)/(b*c -
 a*d), x]^n, x], x] /; FreeQ[{a, b, c, d, m, n}, x] && NeQ[b*c - a*d, 0] &&  !IntegerQ[m] &&  !IntegerQ[n] &&
(RationalQ[m] ||  !SimplerQ[n + 1, m + 1])

Rule 69

Int[((a_) + (b_.)*(x_))^(m_)*((c_) + (d_.)*(x_))^(n_), x_Symbol] :> Simp[((a + b*x)^(m + 1)*Hypergeometric2F1[
-n, m + 1, m + 2, -((d*(a + b*x))/(b*c - a*d))])/(b*(m + 1)*(b/(b*c - a*d))^n), x] /; FreeQ[{a, b, c, d, m, n}
, x] && NeQ[b*c - a*d, 0] &&  !IntegerQ[m] &&  !IntegerQ[n] && GtQ[b/(b*c - a*d), 0] && (RationalQ[m] ||  !(Ra
tionalQ[n] && GtQ[-(d/(b*c - a*d)), 0]))

Rubi steps

\begin{align*} \int (g \cos (e+f x))^p (a+a \sin (e+f x))^m (A+B \sin (e+f x)) \, dx &=-\frac{B (g \cos (e+f x))^{1+p} (a+a \sin (e+f x))^m}{f g (1+m+p)}+\left (A+\frac{B m}{1+m+p}\right ) \int (g \cos (e+f x))^p (a+a \sin (e+f x))^m \, dx\\ &=-\frac{B (g \cos (e+f x))^{1+p} (a+a \sin (e+f x))^m}{f g (1+m+p)}+\frac{\left (a^2 \left (A+\frac{B m}{1+m+p}\right ) (g \cos (e+f x))^{1+p} (a-a \sin (e+f x))^{\frac{1}{2} (-1-p)} (a+a \sin (e+f x))^{\frac{1}{2} (-1-p)}\right ) \operatorname{Subst}\left (\int (a-a x)^{\frac{1}{2} (-1+p)} (a+a x)^{m+\frac{1}{2} (-1+p)} \, dx,x,\sin (e+f x)\right )}{f g}\\ &=-\frac{B (g \cos (e+f x))^{1+p} (a+a \sin (e+f x))^m}{f g (1+m+p)}+\frac{\left (2^{-\frac{1}{2}+m+\frac{p}{2}} a^2 \left (A+\frac{B m}{1+m+p}\right ) (g \cos (e+f x))^{1+p} (a-a \sin (e+f x))^{\frac{1}{2} (-1-p)} (a+a \sin (e+f x))^{-\frac{1}{2}+m+\frac{1}{2} (-1-p)+\frac{p}{2}} \left (\frac{a+a \sin (e+f x)}{a}\right )^{\frac{1}{2}-m-\frac{p}{2}}\right ) \operatorname{Subst}\left (\int \left (\frac{1}{2}+\frac{x}{2}\right )^{m+\frac{1}{2} (-1+p)} (a-a x)^{\frac{1}{2} (-1+p)} \, dx,x,\sin (e+f x)\right )}{f g}\\ &=-\frac{2^{\frac{1}{2} (1+2 m+p)} a \left (A+\frac{B m}{1+m+p}\right ) (g \cos (e+f x))^{1+p} \, _2F_1\left (\frac{1}{2} (1-2 m-p),\frac{1+p}{2};\frac{3+p}{2};\frac{1}{2} (1-\sin (e+f x))\right ) (1+\sin (e+f x))^{\frac{1}{2} (1-2 m-p)} (a+a \sin (e+f x))^{-1+m}}{f g (1+p)}-\frac{B (g \cos (e+f x))^{1+p} (a+a \sin (e+f x))^m}{f g (1+m+p)}\\ \end{align*}

Mathematica [A]  time = 0.447754, size = 154, normalized size = 0.91 \[ -\frac{\cos (e+f x) (a (\sin (e+f x)+1))^m (g \cos (e+f x))^p (\sin (e+f x)+1)^{\frac{1}{2} (-2 m-p-1)} \left (2^{\frac{1}{2} (2 m+p+1)} (A (m+p+1)+B m) \, _2F_1\left (\frac{1}{2} (-2 m-p+1),\frac{p+1}{2};\frac{p+3}{2};\frac{1}{2} (1-\sin (e+f x))\right )+B (p+1) (\sin (e+f x)+1)^{\frac{1}{2} (2 m+p+1)}\right )}{f (p+1) (m+p+1)} \]

Antiderivative was successfully verified.

[In]

Integrate[(g*Cos[e + f*x])^p*(a + a*Sin[e + f*x])^m*(A + B*Sin[e + f*x]),x]

[Out]

-((Cos[e + f*x]*(g*Cos[e + f*x])^p*(1 + Sin[e + f*x])^((-1 - 2*m - p)/2)*(a*(1 + Sin[e + f*x]))^m*(2^((1 + 2*m
 + p)/2)*(B*m + A*(1 + m + p))*Hypergeometric2F1[(1 - 2*m - p)/2, (1 + p)/2, (3 + p)/2, (1 - Sin[e + f*x])/2]
+ B*(1 + p)*(1 + Sin[e + f*x])^((1 + 2*m + p)/2)))/(f*(1 + p)*(1 + m + p)))

________________________________________________________________________________________

Maple [F]  time = 4.148, size = 0, normalized size = 0. \begin{align*} \int \left ( g\cos \left ( fx+e \right ) \right ) ^{p} \left ( a+a\sin \left ( fx+e \right ) \right ) ^{m} \left ( A+B\sin \left ( fx+e \right ) \right ) \, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((g*cos(f*x+e))^p*(a+a*sin(f*x+e))^m*(A+B*sin(f*x+e)),x)

[Out]

int((g*cos(f*x+e))^p*(a+a*sin(f*x+e))^m*(A+B*sin(f*x+e)),x)

________________________________________________________________________________________

Maxima [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int{\left (B \sin \left (f x + e\right ) + A\right )} \left (g \cos \left (f x + e\right )\right )^{p}{\left (a \sin \left (f x + e\right ) + a\right )}^{m}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((g*cos(f*x+e))^p*(a+a*sin(f*x+e))^m*(A+B*sin(f*x+e)),x, algorithm="maxima")

[Out]

integrate((B*sin(f*x + e) + A)*(g*cos(f*x + e))^p*(a*sin(f*x + e) + a)^m, x)

________________________________________________________________________________________

Fricas [F]  time = 0., size = 0, normalized size = 0. \begin{align*}{\rm integral}\left ({\left (B \sin \left (f x + e\right ) + A\right )} \left (g \cos \left (f x + e\right )\right )^{p}{\left (a \sin \left (f x + e\right ) + a\right )}^{m}, x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((g*cos(f*x+e))^p*(a+a*sin(f*x+e))^m*(A+B*sin(f*x+e)),x, algorithm="fricas")

[Out]

integral((B*sin(f*x + e) + A)*(g*cos(f*x + e))^p*(a*sin(f*x + e) + a)^m, x)

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((g*cos(f*x+e))**p*(a+a*sin(f*x+e))**m*(A+B*sin(f*x+e)),x)

[Out]

Timed out

________________________________________________________________________________________

Giac [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: AttributeError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((g*cos(f*x+e))^p*(a+a*sin(f*x+e))^m*(A+B*sin(f*x+e)),x, algorithm="giac")

[Out]

Exception raised: AttributeError